Linux Journal March 2018 by Linux Journal

Linux Journal March 2018 by Linux Journal

Author:Linux Journal
Language: eng
Format: mobi, epub
Publisher: Linux Journal
Published: 2018-03-08T06:00:00+00:00


you can see that the output becomes just the account names. This script could compare full files—heck, there's even a Linux command for the job—but you don't want to get false positives if users change their user names but otherwise leave their accounts intact. Further, I like clean, readable output, so that's what this will produce.

Here's the full script:

#!/bin/sh

# watch accounts - keep an eye on /etc/passwd,

# report if accounts change

secretcopy="$HOME/.watchdb"

tempfile="$HOME/.watchdb.new"

passwd="/etc/passwd"

compare=0 # by default, don't compare



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.